package com.eastcom.notice;

import java.io.IOException;
import java.io.PrintStream;
import java.net.ServerSocket;
import org.apache.log4j.Logger;

public class NoticeServer
{
  private Logger log;
  private ServerSocket service;

  public NoticeServer(int port)
  {
    this.log.info("Notice [Socket] Service is  Create : port[" + port + "]");
    try
    {
      this.service = new ServerSocket(port);
      new Thread(new SingleSocketHandler(this.service)).start();
    } catch (IOException e) {
      this.log.debug("Notice [Socket] service is Error", e);
      this.log.info("Notice is Error");
      e.printStackTrace();
    }
  }

  public static void main(String[] args) {
    new NoticeServer(8080);
    System.out.println(".........");
  }
}